import React, { Component } from 'react';
import { Slider, WingBlank, WhiteSpace, createTooltip } from 'antd-mobile';
import './bookSettingFont.less';

class BookSettingFont extends Component{

	onChangeFont = (val) => {
		this.props.onChangeFont(val);
	}

	render(){
		const { fontSize } = this.props;

		let font = 0.28;
		if(fontSize){
			font = parseFloat(fontSize.replace("rem", ""));
		}

		return(
			<div className="bookSettingFont">
				<div className="bookSettingFontTitle">
					字体设置
				</div>
		      	<Slider 
		      		defaultValue={font} 
		      		min={0.26} 
		      		step={0.02}
		      		max={0.36}
		      		onAfterChange={this.onChangeFont}/>
		    </div>
		)
	}
}

export default BookSettingFont;